import React from 'react'
import { RouteConfig } from '@/types/router'
import { wrapSuspense } from '@/router/lazyLoad'

let UserList = wrapSuspense(React.lazy(() => import('@/views/permissionManage/userManage/list')))
let RoleList = wrapSuspense(React.lazy(() => import('@/views/permissionManage/roleManage/list')))

const route: RouteConfig[] = [
  {
    path: 'product',
    meta: {
      title: '商品管理',
      icon: 'Lock',
      permission: 'Product',
      hidden: false
    },
    children: [
      {
        path: 'bike',
        element: <UserList />,
        meta: {
          title: '单车管理',
          hidden: false,
          permission: 'User',
        }
      },
      {
        path: 'addBike',
        element: <UserList />,
        meta: {
          title: '新增单车',
          hidden: true,
          permission: 'AddBike',
        }
      },
      {
        path: 'brand',
        element: <RoleList />,
        meta: {
          title: '品牌管理',
          hidden: false,
          permission: 'Brand',
        }
      },
    ],
  },
]

export default route
